var mysql      = require('mysql');
var connection = mysql.createConnection({
    host     : 'localhost',
    user     : 'root',
    password : '13209202523cyf',
    database : 'stu'
});

connection.connect();

connection.query('SELECT * from student', function (error, results, fields) {
    if (error) throw error;
    // console.log('id: ', results);
    for(let i = 0;i<results.length;i++){
        console.log("id："+results[i].id+"\tsnum："+results[i].snum+"\tname："+results[i].name+"\tage："+results[i].age+"\tintro："+results[i].intro);
    }
});